#ifndef _SPTS_H
#define _SPTS_H

#ifdef __cplusplus
#ifndef __CDT_PARSER__
extern "C"{
#endif
#endif

typedef int (*pfSPTSDataGot)(unsigned char* pu8Ts, unsigned int u32Len);

typedef enum
{
	SPTS_SI_OK = 0,
	SPTS_STREAM_FREE,
	SPTS_STREAM_ENCRY,
}spts_notify_status_t;

typedef void (*pfNotifyPlayer)(spts_notify_status_t);

typedef struct
{
	unsigned short 		m_u16Pid;
	unsigned int 		m_u32Type;
}spts_es_t;

typedef struct 
{
	unsigned short 		m_u16ServiceId;		//节目service id
	unsigned short		m_u16PmtPid;
	unsigned short 		m_u16PcrPid;
	unsigned short		m_u16EsCnt;
	spts_es_t				m_astEs[0];
} spts_param_t;

typedef enum
{
	SPTS_OUTPUT_NONE = 0x0,
	SPTS_OUTPUT_VIDEO_OK = 0x01,
	SPTS_OUTPUT_AUDIO_OK = 0x02,
	SPTS_OUTPUT_ALL_ES_OK = 0x03,
}spts_status_t;

typedef enum
{
	SPTS_ENCRYTION_UNKNOWED = 0,
	SPTS_ENCRYTION_FREE,
	SPTS_ENCRYTION_VIDEO_SRCAMBLE,
	SPTS_ENCRYTION_AUDIO_SCRAMBLE,
	SPTS_ENCRYTION_SCRAMBLE,
}spts_scramble_status_t;

extern int SPTS_OutputPause();
extern int SPTS_OutputResume();

extern int SPTS_Recognise();
extern int SPTS_OutputStart ();
extern int SPTS_OutputStop ();
extern int SPTS_OutputSet (spts_param_t* pstParam);
extern int SPTS_GetOutputStatus(spts_status_t* peStatus);
extern int SPTS_GetScrambleStatus(spts_scramble_status_t* peStatus);

extern int SPTS_RegisterStartPlayerFun(pfNotifyPlayer pfPlayerNotification);
extern int SPTS_RegisterOutputFun (pfSPTSDataGot pfOutput);
extern int SPTS_Init ();



#ifdef __cplusplus
#ifndef __CDT_PARSER__
}
#endif
#endif

#endif //_SPTS_H
